﻿using CNFM_CROCODILE_LOGO.Core.Domain.Entity;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace CNFM_CROCODILE_LOGO.Data.Mappings.DataMappings
{
    /// <summary>
    /// 系统菜单
    /// </summary>
    public class MenuMap : IBaseEntityTypeConfiguration
    {
        public MenuMap(ModelBuilder entity)
        {
            entity.Entity<Menu>(b =>
            {
                b.Property(e => e.Id)
                    .HasMaxLength(36)
                    .IsUnicode(false)
                    .ValueGeneratedNever();

                b.Property(e => e.Status)
                     .IsUnicode(false)
                     .HasColumnType("int")
                     .HasDefaultValue(0);

                b.Property(e => e.CreateId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .IsUnicode(false);

                b.Property(e => e.CreateTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("(getdate())");

                b.Property(e => e.Remarks)
                    .HasMaxLength(200)
                    .IsUnicode(false);

                b.Property(e => e.SuperionMenuId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .IsUnicode(false);

                b.Property(e => e.MenuName)
                    .IsRequired()
                    .HasMaxLength(100)
                    .IsUnicode(false);

                b.Property(e => e.MuCode)
                    .IsRequired()
                    .HasMaxLength(50)
                    .IsUnicode(false);

                b.Property(e => e.Sql)
                    .IsUnicode(false)
                    .HasColumnType("int")
                    .HasDefaultValue(0);
            });
        }
    }
}
